<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      layout:decorate="main">
<head>
    <meta charset="UTF-8">
    <title>客户开发计划</title>
    <link th:href="@{/static/localcss/userlist.css}" href="../../static/localcss/userlist.css" rel="stylesheet">
    <script th:src="@{/localjs/rollpage.js}" src="../static/localjs/rollpage.js"></script>
    <script th:src="@{/js/jquery.min.js}" src="../static/js/jquery.min.js"></script>
    <script th:src="@{/localjs/plandel.js}" src="../static/localjs/plandel.js"></script>
</head>
<body>
<div layout:fragment="content">

    <div class="row">

        <div class="col-lg-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>
                        制定计划<i class="fa fa-plane"></i>
                    </h2>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>

        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h5>Basic Info</h5>
                </div>
                <div class="x_content">
                    <table  id="datatable-responsive"
                            class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
                            cellspacing="0" width="100%" role="grid"
                            aria-describedby="datatable-responsive_info"
                            style="width: 100%;">
                        <thead>
                            <th>#</th>
                            <th>content</th>
                            <th>#</th>
                            <th>content</th>
                        </thead>
                        <tbody>
                            <tr>
                                <th>编号</th>
                                <td th:text="${chance.getChcId()}"></td>
                                <th>机会来源</th>
                                <td th:text="${chance.getChcSource()}"></td>
                            </tr>
                            <tr>
                                <th>客户名称</th>
                                <td th:text="${chance.getChcCustName()}"></td>
                                <th>成功几率(%)</th>
                                <td th:text="${chance.getChcRate()}"></td>
                            </tr>
                            <tr>
                                <th>负责人</th>
                                <td th:text="${chance.getChcDueTo()}"></td>
                                <th>联系电话</th>
                                <td th:text="${chance.getChcTel()}"></td>
                            </tr>
                            <tr>
                                <th>概要</th>
                                <td th:text="${chance.getChcTitle()}"></td>
                            </tr>
                            <tr>
                                <th>机会描述</th>
                                <td th:text="${chance.getChcDesc()}"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_content">
                    <table class="table">
                        <thead>
                            <th>日期</th>
                            <th>计划项</th>
                            <th>操作</th>
                        </thead>
                        <tbody>
                            <tr th:each="plan : ${plans}">
                                <td th:text="${plan.getPlaDate()}"></td>
                                <td th:text="${plan.getPlaTodo()}"></td>
                                <td>
                                    <div class="btn-group">
                                        <button type="button" class="btn btn-danger">点击操作</button>
                                        <button type="button"
                                                class="btn btn-danger dropdown-toggle"
                                                data-toggle="dropdown" aria-expanded="false">
                                            <span class="caret"></span>
                                            <span class="sr-only">Toggle Dropdown</span>
                                        </button>
                                        <ul class="dropdown-menu" role="menu">
                                            <li>
                                                <a th:href="@{/plan/editPlaTodo(plaId=${plan.plaId})}"
                                                   class="editPlan"
                                                   data-toggle="tooltip"
                                                   data-placement="top" title=""
                                                   data-original-title="编辑">编辑</a>
                                            </li>

                                            <li>
                                                <a href="javascript:;" th:onclick="'javascript:del('+this+','+${plan.plaId}+');'"
                                                   class="deletePlan"
                                                   data-toggle="tooltip"
                                                   data-placement="top" title=""
                                                   data-original-title="删除">删除</a>
                                            </li>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h5>添加计划</h5>
                </div>
                <div class="x_content">
                    <form class="form-horizontal form-label-left" th:action="@{/plan/savePlan}" action="/plan/savePlan" method="post">
                        <input type="hidden" id="chcId" name="chcId" th:value="${chance.chcId}" value="" />
                        <div class="form-group col-lg-4">
                            <label class="control-label">日期<span class="required">*</span></label>
                            <div class="input-group date">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                <input type="text"
                                       class="form-control"
                                       name="plaDate" id="plaDate"
                                       th:value="${plaDate}" value="" />
                            </div>
                        </div>
                        <div class="form-group col-lg-4">
                            <label class="control-label">计划项<span class="required">*</span></label>
                            <div class="input-group text">
                                <span class="input-group-addon"><i class="fa fa-info"></i></span>
                                <input id="plaTodo" name="plaTodo"
                                       class="form-control"
                                       data-validate-length-range="20" data-validate-words="1"
                                       required="required" type="text">
                            </div>
                        </div>

                        <div class="form-group col-lg-4">
                            <label class="control-label">操作</label>
                            <div class="input-group">
                                <button id="send" type="submit" class="btn btn-success">保存</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <form class="form-horizontal form-label-left" th:action="@{/plan/execute}" action="execute.html" method="post">
                    <input type="hidden" name="chcId" th:value="${chance.chcId}" value="" />
                    <div class="col-md-10 col-md-offset-5">
                        <button type="button" class="btn btn-info">帮助</button>
                        <button type="submit" class="btn btn-warning" shiro:hasRole="客户经理">执行计划</button>
                        <button type="button" class="btn btn-primary" id="back"
                                onclick="javascript:window.history.back();">返回
                        </button>
                        <br/><br/>
                    </div>
                </form>
            </div>
        </div>

    </div>
</div>
</body>
</html>